package ObjectOriented;

public class MemoryAllocation02 {
    public static void main(String[] args) {
        Person a = new Person();
        a.age = 10;
        a.name = "小明";
        Person b = a;
        System.out.println(b.name);
        b.age = 200;
        b = null;
        System.out.println(a.age);//200
        //System.out.println(b.age);//异常
    }
}
/*class Person {
    int age;
    String name;
}
*/